
import "@/css/match.scss"
import {LoadMore} from  "@/js/utils/load_more.js"
import queryString from "query-string";
import "@/js/utils/lazyload.js"
if(module.hot) {
    module.hot.accept()
 }

 
$(function(){
    
    class Hmnn {
        Initialization(){
           this.getData()
        }
        getData(){
                const parsed = queryString.parse(location.search);
                let _this=this;
                let laodMore=new LoadMore()
                laodMore.Initialization({
                    url:API.share.feed,
                    page:1,
                    data:parsed,
                    method:"get",
                    ele:".match_list",
                    success:function (e,page) {
                      if(e.rescode==0){
                        if(e.hasMore==true){
                            this.page=page+1;
                        }
                        else
                        {
                            this.page=page;
                        }
                        //渲染list
                         const renderList=function(data){
                            var html='<a class="item" href="http://mp.hippo体育.cn/article/detail/'+data.itemId+'">\
                                    <img  class="lazy"  data-original='+data.pic+' />\
                                    <div class="title">'+data.title+'</div>\
                                    <div class="dz_dflex">\
                                        <div class="dz_flex">\
                                        '+(data.authorLabel.sourceName!=null?data.authorLabel.sourceName:"")+'\
                                          '+data.authorLabel.name+'\
                                        </div>\
                                        <div class="time">'+data.groupDate+'</div>\
                                    </div>\
                                </div>\
                            </a>'
                            return html
                        }
                        let li=""
                        for(var i=0;i<e.items.length;i++){
                            li+=renderList(e.items[i])
                        }
                        $(li).appendTo(this.ele)
                        document.title=e.feed.description
                        $("img.lazy").lazyload({effect: "fadeIn"});
                        //页面显示
                        $(".page-load").hide()
                        $(".page-body").show()
                      }
                      else
                      {
                        DZ.form.Prompt(e.resmsg,1)
                      }
                    }
                })
        }
    }
    var hmnn = new Hmnn();
     hmnn.Initialization()

})

